import request from "@/plugins/axios";
//  获取客户自定义字段列表
export function customerApi(data) {
  return request({
    url: "/crm/sys.field/customer",
    method: "post",
    data,
  });
}
//  增加客户自定义字段列表
export function addCustomerApi(data) {
  return request({
    url: "/crm/sys.field/addCustomer",
    method: "post",
    data,
  });
}
//  获取联系人自定义字段列表
export function contactsApi(data) {
  return request({
    url: "/crm/sys.field/contacts",
    method: "post",
    data,
  });
}
//  增加联系人自定义字段列表
export function addContactsApi(data) {
  return request({
    url: "/crm/sys.field/addContacts",
    method: "post",
    data,
  });
}
// 自定义字段删除
export function deleteApi(data) {
  return request({
    url: "/admin/field/delete",
    method: "post",
    data,
  });
}
// 自定义字段修改
export function saveApi(data) {
  return request({
    url: "/crm/sys.field/save",
    method: "post",
    data,
  });
}
// 自定义字段修改状态
export function stateApi(data) {
  return request({
    url: "/crm/sys.field/state",
    method: "post",
    data,
  });
}
//  获取指定客户自定义字段列表
export function getAListOfSpecifiedCustomFields(data) {
  return request({
    url: "/crm/sys.field/tbfields",
    method: "post",
    data,
  });
}


// 增加指定自定义字段
export function addCustomFields(data) {
  return request({
    url: "/crm/sys.field/addFields",
    method: "post",
    data,
  });
}

// 修改字段属性排序字段，显示名
export function updateField(data) {
  return request({
    url: "/crm/sys.field/updateField",
    method: "post",
    data,
  });
}

// 搜索客户
export function searchForCustomer(data) {
  return request({
    url: "/crm/customer/options",
    method: "post",
    data,
  });
}

// 获取地址选择项
export function getAddressOptions(data) {
  return request({
    url: "/admin/login/regionTree",
    method: "get",
    data,
  });
}
